#!/usr/bin/env python
# encoding: utf-8
'''
@author: zhaowenpeng
@contact: winston@peipeiyun.com
@software: garner
@file: pandas_sheets_to_excel.py
@time: 2020/7/30 7:58 下午
@desc:
'''

import pandas as pd
import os
excel_name = '/Users/carl/Downloads/有道电子扇.xls' #指定文件夹路径

xls_file = pd.ExcelFile(excel_name)
sheet_names = xls_file.sheet_names           #获取excel文件的所有sheet名
# writer = pd.ExcelWriter(path+'\\'+'result.xlsx')#设置excel框架，保证多次写入sheet时不会去被覆盖
for sheet in sheet_names:
    filename=sheet+'.xlsx'
    pd1 = pd.read_excel(excel_name, sheet)
    pd1.to_excel(filename,)
